# -*- encoding: utf-8 -*-
############################################################################
#    Copyright (C) 2007-2010 by Håvard Gulldah                             #
#    havard@gulldahl.no                                                    #
#                                                                          #
#    This program is free software; you can redistribute it and#or modify  #
#    it under the terms of the GNU General Public License as published by  #
#    the Free Software Foundation; either version 2 of the License, or     #
#    (at your option) any later version.                                   #
#                                                                          #
#    This program is distributed in the hope that it will be useful,       #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#    GNU General Public License for more details.                          #
#                                                                          #
#    You should have received a copy of the GNU General Public License     #
#    along with this program; if not, write to the                         #
#    Free Software Foundation, Inc.,                                       #
#    59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             #
############################################################################

from django.conf import settings
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()


urlpatterns = patterns('ejejeweb.ejeje.views',
    (r'^$', 'index'),
    (r'^oversikt$', 'dashboard'),
    (r'^detaljer/(?P<table>\w+)/(?P<pid>\d+)(?P<json>.json)?$', 'details'), 
    (r'^katalog(?P<json>.json)?$', 'directory'), 
    (r'^innsyn((/ny/(?P<journalpost_id>\d+))|(/(?P<request_id>\d+)))?$', 'requestdoc'),
    (r'^klage/(?P<request_id>\d+)$', 'requestagain'),
    (r'^agent(?P<json>.json)?$', 'agent'),
    (r'^historikk$', 'history'),
    (r'^om$', 'about'),
    (r'^innlogging(?P<json>.json)?$', 'login'),
    (r'^nyheter(/(?P<newsid>\d+)(-[-\w]+)?)?(\.(?P<format>atom|json))?$', 'news'),
#    (r'^nyheter(/kategori/(?P<tag>[\w]+)?)(\.(?P<format>atom|json))?$', 'news'),
    (r'^finn(\.(?P<format>atom|json))?$', 'search'),
)
    
urlpatterns += patterns('',
    (r'^utlogging$', 'django.contrib.auth.views.logout', {'template_name':'ejeje/logged_out.html'}),
    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)

if settings.DEVELOPMENT_MODE:
  urlpatterns += patterns('',
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
      {'document_root': settings.MEDIA_ROOT}),
  )

